/*© 2010-2011 mOcean Mobile. A subsidiary of Mojiva, Inc. All Rights Reserved.*/
package com.adserver.adview.examples;

import com.adserver.adview.AdServerException;
import com.adserver.adview.AdServerView;
import com.adserver.adview.Logger;
import com.adserver.adview.interfaces.OnAdWebViewClosing;

import java.util.logging.Level;

class AdServerSample4 extends AdServerViewSampleRunner {
    private static final int width = 320;
    private static final int height = 460;

    @Override
    protected void initAdServerView() throws AdServerException {
        // Default mOcean ad with "test == 1"
        adServerView = new AdServerView("8061", "20249");
        adServerView.setMinSizeX(width);
        adServerView.setMinSizeY(height);
        adServerView.setTest(true);
        adServerView.setAdWebViewClosing(new UserAdWebViewClosing());
    }

    class UserAdWebViewClosing implements OnAdWebViewClosing {
        public void process(String url) {
            String msg = "UserAdWebViewClosing click from com.adserver.adview.examples.AdServerSample4: " + url;
            Logger.getInstance().logText(Level.INFO, msg);
        }
    }

    public static void main(String args[]) throws AdServerException {
        AdServerSample4 adServerSample = new AdServerSample4();
        adServerSample.initAdServerView();
        adServerSample.runSample();
    }
}